<%@ include file="/taglibs.jsp"%>

<title><fmt:message key="categoryList.title"/></title>

<div align="right">
<button onclick="location.href='editCategory.html?fieldId=${fieldId}'" style="text-align: center;" >
	<fmt:message key="button.add.title"></fmt:message>
	<img src="${ctx}/images/btn_add.png" align="left" height="20" width="20">
</button>
<button onclick="location.href='searchCategory.html'">
	<fmt:message key="button.search.title"></fmt:message>
	<img src="${ctx}/images/btn_search.png" align="left" height="20" width="20">
</button>
</div>
<br/>
<s:set name="categories" value="list" scope="request"/>
<s:set var="item_name" value="%{getText('category.item_name')}" scope="page"></s:set>
<s:set var="items_name" value="%{getText('category.items_name')}" scope="page"></s:set>
<s:form name="listCategoryForm" action="getCategoryByField" method="post" validate="false">
	<s:select key="fieldList.field.name" list="fields" value="fieldId" name="fieldId" listKey="id" listValue="name" onchange="form.submit()"/>
</s:form>
<display:table name="categories" class="table" requestURI="" id="categoryList" pagesize="10" >
	<display:setProperty name="paging.banner.item_name" value="${item_name}"/>
	<display:setProperty name="paging.banner.items_name" value="${items_name}" />
    <!-- display:column property="id" sortable="true" href="viewCategory.html" media="html"
        paramId="cateId" paramProperty="id" titleKey="category.id" -->
    <display:column property="categoryName" sortable="true" titleKey="category.categoryName" escapeXml="true"/>
    <display:column style="width:100px;" titleKey="category.function">
    	<button type="submit" class="button" name="edit" onclick="location.href='viewCategory.html?cateId=${categoryList.id}';">
			<fmt:message key="button.view.title"></fmt:message>
		</button>
    	<button type="submit" class="button" name="edit" onclick="location.href='editCategory.html?cateId=${categoryList.id}';">
			<fmt:message key="button.edit.title"></fmt:message>
		</button>
	</display:column>
    
</display:table>

<button onclick="location.href='editCategory.html?fieldId=${fieldId}'" style="text-align: center;" >
	<fmt:message key="button.add.title"></fmt:message>
	<img src="${ctx}/images/btn_add.png" align="left" height="20" width="20">
</button>
<button onclick="location.href='searchCategory.html'">
	<fmt:message key="button.search.title"></fmt:message>
	<img src="${ctx}/images/btn_search.png" align="left" height="20" width="20">
</button>
